import type { IUser } from '@/assets/js/utils/entity/IUser'
import { instance } from '@/configs/request/index'
import { CacheUserUtil } from '@/assets/js/utils/CacheUserUtil'

export const login = (user: IUser) => {
    const url = `/ams-auth/oauth/token?grant_type=password&username=${user.username}&password=${user.password || ''}`
    return instance.post(url, null, {
        headers: {
            Authorization: 'Basic YW1zOmFtcw=='
        }
    })
}